﻿using MengLin.OOP.DesignPattern.Command.ControlTV.Entity;
using MengLin.OOP.DesignPattern.Command.ControlTV.Implements;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MengLin.OOP.DesignPattern.Command.ControlTV
{
    class Program
    {
        static void Main(string[] args)
        {
            //命令接收者
            TV tv = new TV();
            //开机命令
            CommandOn commandOn = new CommandOn(tv);
            //关机命令
            CommandOff commandOff = new CommandOff(tv);
            //改变频道命令
            CommandChange commandChange = new CommandChange(tv,2);
            //命令发起者
            //遥控器有什么命令，你给它什么命令，它就有什么命令
            Control control = new Control(commandOn, commandOff, commandChange);
            //开机
            control.TurnOn();
            //改变频道
            control.ChangeChannel();
            //关机
            control.TurnOff();

            Console.ReadLine();
        }
    }
}
